/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package CareerService.Entitybeans;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "stu_cv")
@NamedQueries({@NamedQuery(name = "StuCv.findAll", query = "SELECT s FROM StuCv s"), @NamedQuery(name = "StuCv.findByCvId", query = "SELECT s FROM StuCv s WHERE s.cvId = :cvId"), @NamedQuery(name = "StuCv.findByCv", query = "SELECT s FROM StuCv s WHERE s.cv = :cv"), @NamedQuery(name = "StuCv.findByCvStatus", query = "SELECT s FROM StuCv s WHERE s.cvStatus = :cvStatus"), @NamedQuery(name = "StuCv.findByConfirmed", query = "SELECT s FROM StuCv s WHERE s.confirmed = :confirmed")})
public class StuCv implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "cv_id")
    private Integer cvId;
    @Column(name = "cv")
    private String cv;
    @Basic(optional = false)
    @Column(name = "cv_status")
    private short cvStatus;
    @Basic(optional = false)
    @Column(name = "confirmed")
    private short confirmed;
    @OneToMany(mappedBy = "cvId")
    private Collection<Student> studentCollection;

    public StuCv() {
    }

    public StuCv(Integer cvId) {
        this.cvId = cvId;
    }

    public StuCv(Integer cvId, short cvStatus, short confirmed) {
        this.cvId = cvId;
        this.cvStatus = cvStatus;
        this.confirmed = confirmed;
    }

    public Integer getCvId() {
        return cvId;
    }

    public void setCvId(Integer cvId) {
        this.cvId = cvId;
    }

    public String getCv() {
        return cv;
    }

    public void setCv(String cv) {
        this.cv = cv;
    }

    public short getCvStatus() {
        return cvStatus;
    }

    public void setCvStatus(short cvStatus) {
        this.cvStatus = cvStatus;
    }

    public short getConfirmed() {
        return confirmed;
    }

    public void setConfirmed(short confirmed) {
        this.confirmed = confirmed;
    }

    public Collection<Student> getStudentCollection() {
        return studentCollection;
    }

    public void setStudentCollection(Collection<Student> studentCollection) {
        this.studentCollection = studentCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cvId != null ? cvId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StuCv)) {
            return false;
        }
        StuCv other = (StuCv) object;
        if ((this.cvId == null && other.cvId != null) || (this.cvId != null && !this.cvId.equals(other.cvId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "CareerService.Entitybeans.StuCv[cvId=" + cvId + "]";
    }

}
